#include "buttons.h"
#include "clock.h"
#include "LEDs.h"
#include "light_sensor.h"
#include "uart.h"
#include "system.h"
#include "timers.h"
#include "types.h"

#include <stdio.h>

void initialize(void);

void main(void) {
	initialize();
	EI();
	while(1) {
		read_sensor();
		wait(500);
		check_buttons();
	}
}

void initialize(void) {
	initialize_clock();
	init_buttons();
	initialize_led_timer();
	initialize_leds();
	uart_initialize();
	light_sensor_initialize();

	set_scroll_on(false);
	set_led_text("READ");
}